//
//  ProduceCollectionViewCell.m
//  ZYZB
//
//  Created by ENERGY on 2018/6/25.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "ProduceCollectionViewCell.h"
@interface ProduceCollectionViewCell()
@property (nonatomic, strong)UIImageView * imageView;
@property (nonatomic, strong)NSString * bidSeriesID;//标的系列ID
@property (nonatomic, strong)NSString * titleID;//字段里的pid，不知道干啥用……
@end
@implementation ProduceCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.imageView];
        [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.equalTo(weakSelf.contentView);
        }];
    }return self;
}

- (UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [[UIImageView alloc] init];
        _imageView.backgroundColor = getColor(grayColor);
    }return _imageView;
}

- (void)setModel:(NSDictionary *)model{
    _model = model;
    if ([model[@"twolab"] isEqualToString:@"供应链系列"]) {
        self.imageView.image = [UIImage imageNamed:@"fulegongyinglian"];
    }
    if ([model[@"twolab"] isEqualToString:@"惠民系列"]) {
        self.imageView.image = [UIImage imageNamed:@"fulehuimincunguan"];
    }
    if ([model[@"twolab"] isEqualToString:@"福乐体验"]) {
        self.imageView.image = [UIImage imageNamed:@"fulechujietiyan"];
    }
    if ([model[@"twolab"] isEqualToString:@"公共服务系列"]) {
        self.imageView.image = [UIImage imageNamed:@"fulegonggongfuwu"];
    }
    if ([model[@"twolab"] isEqualToString:@"福乐月息"]) {
        self.imageView.image = [UIImage imageNamed:@"fuleyuexi"];
    }
    if ([model[@"twolab"] isEqualToString:@"福乐白金"]) {
        self.imageView.image = [UIImage imageNamed:@"fulebaijin"];
    }
    self.bidSeriesID = model[@"markid"];
    self.titleID = model[@"pid"];
}
@end
